<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./static/static/vue.min.js"></script>
  <script src="./static/static/axios.min.js"></script>
  <!-- 本地引入lib-master -->
  <link rel="stylesheet" type="text/css" href="./static/lib-master/theme-chalk/index.css" />
  <script src="./static/lib-master/index.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>
  <div id='app'>
    <h1>测试</h1>
    {{houseId}},{{token}}
  </div>

  <script>
    new Vue({
      el: '#app',
      data () {
        return {
          houseId: '123',
          token: localStorage.getItem('token')
        }
      },
      watch: {

      },
      created () {
        localStorage.setItem("url", this.houseId)
        this.houseId = this.getQueryString("houseId");
      },
      //方法集合
      methods: {
        //获取路径参数
        getQueryString (name) {//name为传入参数

          var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

          var r = window.location.search.substr(1).match(reg);

          if (r != null) return unescape(r[2]); return null;

        }
      },
    })
    alert(localStorage.getItem("url"))
  </script>
</body>

</html>